﻿@{
    Layout = "../Shared/_Default.cshtml";
    ViewBag.PageTitle = T(Res.Name("Title"), JDM.Int64(Model.Index.TotalCount));
}

@section Toolbar
{
    @{
        Html.RenderPartial("_Mode");
    }
}
@section Sidebar
{
    <div class="box">
        <header>
            <h3>@T(Res.Name("Filter"))</h3>
        </header>
        <section>
        @{
            Html.RenderAction(Loc.Act("_Filter").Localized());
        }
        </section>
    </div>
}
<div class="box">
    <section>
    @{
        Html.RenderPartial(Request.QueryParam("view").Equals("list") 
              ? "_List" 
              : "_Grid", 
              (object)Model.Index);
        Html.RenderPartial("_Pager", new ViewDataDictionary 
        { 
            { "PageNum", 6 },
            { "PageCount", Math.Ceiling(JDM.Double(Model.Index.TotalCount) / Model.CountPerPage) }, 
            { "PageIndex", Request.QueryParam("page", 0) },
            { "PageParam", "page" },
            { "PageSize", Model.CountPerPage },
            { "PageRoute", Loc.Act("Index").Use("view", 
                "sortBy", "sortDesc", "priceFrom", 
                "priceTo", "searchTerm", "sellerID", 
                "categoryID", "supplierID", "itemID", 
                "attributeIDs").Localized() } 
        });
    }
    </section>
</div>
